﻿using System;
using QDT.Common;
using QDT.Core.Members;
using QDT.Core.Projects;

namespace QDT.Core.Deals
{
    /// <summary>
    /// 投资的交易信息类
    /// </summary>
    public class DealOfLoan : Loan, IAggregeRoot
    {
        public DealOfLoan()
        {
            CreateTime = DateTime.Now;
        }

        public DealOfLoan(Project project, User user, decimal money)
            : this()
        {
            Check.Argument.IsNotNull(project, "project");
            Check.Argument.IsNotNull(user, "user");

            ProjectID = project.ID;
            UserID = user.ID;
            UserName = user.UserName;
            Money = money;
        }

        /// <summary>
        /// 所投项目的ID
        /// </summary>
        public int ProjectID { get; private set; }
        
    }
}
